pp108 : hasFormat() Method

hasFormat() Method


This method indicates whether the data saved to the clipboard can be retrieved in a specified format.

If the format of the stored clipboard data is different from the requested format, the application tries to convert the format.

Syntax

system.getClipboard().hasFormat(sFormat);

Parameters

Parameter

Description

sFormat

Required. Indicates whether the data on the clipboard is in the specified format or can be converted to the specified format. Text and XML data formats are predefined and are supported by default.


Return Value

Returns the following:

  • 1 or True: Returns this value to denote that the data can be converted, if required, and retrieved in the specified format.
  • 0 or False: Returns this value to denote that the data cannot be retrieved in the specified format.

Example

If ( system.getClipboard().hasFormat('XML') )
{
      var copyXML = system.getClipboard().getData('XML');
}